/*


 */

package jas.rpc.server;

import jas.rpc.*;
import java.lang.reflect.InvocationTargetException;

/**
 * An object that reacts to remote procedure calls. This should exist on the server-side,
 * and is responsible for routing the call to the correct object.
 */
public interface RpcListener {
	/**
	 * Called when a remote procedure call has been requested by a client. The listener would normally route
	 * the call to the correct object, but this interface mandates to specific behaviour.
	 * 
	 * @param request the request made by the client
	 * @return object returned by the procedure call, to be sent back to the client.
	 * @throws NoSuchMethodException
	 * @throws InvocationTargetException
	 * @throws NonRemoteMethodException if the invoked method exists but may not be called remotely.
	 */
    Object call(RpcRequest request) throws NoSuchMethodException, InvocationTargetException, NonRemoteMethodException;
}
